<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="第三十一章Springunit1 Spring-IOC 1 spring框架简介  1.1 spring是什么  Spring框架是一个开放源代码的J2EE应用程序框架，由Rod Johnson发起，是针对bean的生命周期进行管理的轻量级容器（lightweight container）。 Spring解决了开发者在J2EE开发中遇到的许多常见的问题，提供了功能强大IOC、AOP及Web MVC">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo">
<meta property="og:url" content="https://goofyer.gitee.io/notes-on-computer-expertise/2021/12/20/Java/%E7%AC%AC%E4%B8%89%E5%8D%81%E4%B8%80%E7%AB%A0Spring/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="第三十一章Springunit1 Spring-IOC 1 spring框架简介  1.1 spring是什么  Spring框架是一个开放源代码的J2EE应用程序框架，由Rod Johnson发起，是针对bean的生命周期进行管理的轻量级容器（lightweight container）。 Spring解决了开发者在J2EE开发中遇到的许多常见的问题，提供了功能强大IOC、AOP及Web MVC">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2021-12-19T17:37:41.334Z">
<meta property="article:modified_time" content="2021-12-19T17:37:42.215Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/notes-on-computer-expertise/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/notes-on-computer-expertise/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/notes-on-computer-expertise/css/style.css">

  
    
<link rel="stylesheet" href="/notes-on-computer-expertise/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/notes-on-computer-expertise/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/notes-on-computer-expertise/">Home</a>
        
          <a class="main-nav-link" href="/notes-on-computer-expertise/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/notes-on-computer-expertise/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://goofyer.gitee.io/notes-on-computer-expertise"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-Java/第三十一章Spring" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/notes-on-computer-expertise/2021/12/20/Java/%E7%AC%AC%E4%B8%89%E5%8D%81%E4%B8%80%E7%AB%A0Spring/" class="article-date">
  <time class="dt-published" datetime="2021-12-19T17:37:41.334Z" itemprop="datePublished">2021-12-20</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h2 id="第三十一章Spring"><a href="#第三十一章Spring" class="headerlink" title="第三十一章Spring"></a>第三十一章Spring</h2><h3 id="unit1-Spring-IOC"><a href="#unit1-Spring-IOC" class="headerlink" title="unit1 Spring-IOC"></a>unit1 Spring-IOC</h3><ul>
<li><p>1 spring框架简介</p>
<ul>
<li><p>1.1 spring是什么</p>
<ul>
<li>Spring框架是一个开放源代码的J2EE应用程序框架，由Rod Johnson发起，是针对bean的生命周期进行管理的轻量级容器（lightweight container）。 Spring解决了开发者在J2EE开发中遇到的许多常见的问题，提供了功能强大IOC、AOP及Web MVC等功能。Spring可以单独应用于构筑应用程序，也可以和Struts、Webwork、Tapestry等众多Web框架组合使用，并且可以与 Swing等桌面应用程序AP组合。因此， Spring不仅仅能应用于JEE应用程序之中，也可以应用于桌面应用程序以及小应用程序之中。Spring框架主要由七部分组成，分别是 Spring Core、 Spring AOP、 Spring ORM、 Spring DAO、Spring Context、 Spring Web和 Spring Web MVC。</li>
<li>轻量级：与EJB相比，依赖资源少，消耗资源少</li>
<li><p>核心功能</p>
<ul>
<li>IOC/DI：控制反转依赖注入</li>
<li>AOP：面向切面编程</li>
</ul>
</li>
</ul>
</li>
<li><p>1.2IOC</p>
<ul>
<li><p>主动控制</p>
<ul>
<li>有应用程序主动控制管理对象组件，适合管理创建过程简单得对象</li>
</ul>
</li>
<li><p>控制反转</p>
<ul>
<li>由外部容器环境创建管理对象组件交给应用程序使用，是和管理创新过程复杂得对象，从对象使用者的角度看是简单的</li>
</ul>
</li>
<li><p>第一个测试程序</p>
<ul>
<li>public class Demo {<br>@Override<br>public String toString()<br>{<br>return “Hello World”;<br>}<br>}</li>
<li>@Configuration<br>public class Config {<br>@Bean<br>/**<ul>
<li>告诉spring在启动时候，加载被@Bean标注得方法</li>
<li>返回值是Spring创建得对象，方法名是Bean得ID<br>*/<br>public Demo bean()<br>{<br>return new Demo();<br>}<br>}</li>
</ul>
</li>
<li>public class DemoApplication {</li>
</ul>
</li>
</ul>
<p>public static void main(String[] args) {<br>  //SpringApplication.run(DemoApplication.class, args);<br>  AnnotationConfigApplicationContext ctx =</p>
<pre><code>      new AnnotationConfigApplicationContext(Config.class);
</code></pre><p>  Demo demo = ctx.getBean(“bean”, Demo.class);<br>  System.out.println(demo);<br>}</p>
</li>
</ul>
</li>
</ul>
<p>}</p>
<pre><code>- 1.3 Java Bean
</code></pre><ul>
<li><p>2利用JUnit测试</p>
<ul>
<li><p>2.1使用junit</p>
<ul>
<li><p>在test编写测试案例</p>
<ul>
<li>public class TestCase {<br>@Test<br>public void test()<br>{<br>System.out.println(“Hello World”);<br>}<br>}</li>
</ul>
</li>
<li><p>测试</p>
<ul>
<li>Hello World</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Process finished with exit code 0</p>
<pre><code>- 2.2利用junit测试Spring

    - 代码

        - public class TestCase &#123;
AnnotationConfigApplicationContext ctx;

@Before
public void init() &#123;
    ctx = new AnnotationConfigApplicationContext(Config.class);
    System.out.println(&quot;初始化spring&quot;);
&#125;

@After
public void destroy() &#123;
    ctx.close();
    System.out.println(&quot;销毁spring&quot;);
&#125;

@Test
public void testBean() &#123;
    Demo demo = ctx.getBean(&quot;bean&quot;, Demo.class);
    System.out.println(demo);
&#125;

    - 测试

        - 初始化spring
</code></pre><p>Hello World<br>09:57:14.413 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@61d47554, started on Thu May 27 09:57:13 CST 2021<br>销毁spring</p>
<ul>
<li><p>3组件扫描</p>
<ul>
<li><p>3.1spring组件扫描功能</p>
<ul>
<li>Spring提供组件扫描注解,利用组件爱你扫描注解和组件注解配合,可以自动扫描包空间创造bean对象,减少编码,提高效率</li>
<li><p>1.使用组件@Component注解声明类</p>
<ul>
<li>@Component// spring在组件扫描时候回找到标注componet<br>//将类创建为对象 并其bean id为demobean<br>public class DemoBean implements Serializable<br>{<br>@Override<br>public String toString()<br>{<br>return “DemoBean”;<br>}<br>}</li>
</ul>
</li>
<li><p>2.在配置类注明扫描</p>
<ul>
<li>@ComponentScan(basePackages = “com.example.junit”)</li>
</ul>
</li>
<li><p>3.测试</p>
<ul>
<li>@Test<br>public  void testDeanBean()<br>{<br>//测试组件扫描<br>DemoBean bean=ctx.getBean(“demoBean”,DemoBean.class);<br>System.out.println(bean);<br>}</li>
</ul>
</li>
</ul>
</li>
<li><p>3.2spring提供多种组件扫描</p>
<ul>
<li>@Controller 控制器组件</li>
<li>@Service业务层组件</li>
<li>@Component通用组件</li>
<li><p>测试:编写被扫描的组件</p>
<ul>
<li>@Controller<br>public class DemoController implements Serializable{<br>@Override<br>public String toString()<br>{<br>return “DemoController”;<br>}<br>}<br>@Service<br>public class DemoService implements Serializable{<br>@Override<br>public String toString()<br>{<br>return “DemoService”;<br>}<br>}</li>
</ul>
</li>
<li><p>测试</p>
<ul>
<li>@Test<br>public void DemoController()<br>{<br>/<em><br>测试利用controller创建bean组件
</em>/<br>DemoController controller=ctx.getBean(“demoController”,DemoController.class);<br>System.out.println(controller);<br>}<br>@Test<br>public void DemoService()<br>{<br>/<em><br>测试利用controller创建bean组件
</em>/<br>DemoService service=ctx.getBean(“demoService”, DemoService.class);<br>System.out.println(service);<br>}</li>
</ul>
</li>
</ul>
</li>
<li><p>3.3自定义组件id</p>
<ul>
<li>在使用组件扫描功能时候@Component注解可以添加属性，自定义组件id</li>
</ul>
</li>
</ul>
</li>
<li><p>4.spring bean的管理</p>
<ul>
<li><p>4.1bean作用域</p>
<ul>
<li>@Test<br>public void testSingleton()<br>{<br>/<em><br>默认情况，spring单利管理对象
</em>/<br>DemoBean b1=ctx.getBean(“demoBean”,DemoBean.class);<br>DemoBean b2=ctx.getBean(“demoBean”,DemoBean.class);<br>System.out.println(b1==b2);<br>}<br>@Test<br>public void testPrototype()<br>{<br>/<em><br>测试：原型、<br>每次获取的都是一个新实例
</em>/<br>ExampleBean b1=ctx.getBean(“exampleBean”,ExampleBean.class);<br>ExampleBean b2=ctx.getBean(“exampleBean”,ExampleBean.class);<br>System.out.println(b1==b2);<br>}</li>
</ul>
</li>
<li><p>4.2对象生命周期</p>
<ul>
<li>管理方式：</li>
<li><p>2声明bean组件类型</p>
<ul>
<li>@Component<br>public class FileLogger {<br>public PrintWriter out;<br>@PostConstruct<br>public void open() throws IOException<br>{<br>out=new PrintWriter(“Z:\\Demo.txt”);<br>System.out.println(“open demo”);<br>}<br>@PreDestroy<br>public void close()<br>{<br>out.close();;<br>System.out.println(“close demo”);<br>}</li>
</ul>
</li>
</ul>
<p>@Configuration<br>public static class Config {<br>  @Bean<br>  /<em><br>  告诉spring在启动时候加重被bean标注的方法
   </em>/<br>  public Demo bean()<br>  {</p>
<pre><code>  return new Demo();
</code></pre><p>  }<br>}<br>}</p>
<ul>
<li><p>测试</p>
<ul>
<li>@Test<br>public void testFileLogger()<br>{<br>/*<br>测试spring对象生命周期管理功能<br>spring创建时候bean对象自动执行初始化方法<br>spring关闭时候销毁对象</li>
</ul>
</li>
</ul>
<p>*/<br>FileLogger logger=ctx.getBean(“fileLogger”,FileLogger.class);<br>logger.out.println(“dddd”);<br>logger.out.println(“dddd”);<br>}</p>
<pre><code>  - @Test
</code></pre><p>public void testDemoLogger()<br>{<br>/<em><br>测试 bean对象生命周期管理功能
</em>/<br>DemoLogger logger=ctx.getBean(“demoLogger”,DemoLogger.class);<br>logger.out.println(“dddd”);<br>logger.out.println(“dddd”);<br>}</p>
</li>
<li><p>4.3懒惰初始化</p>
<ul>
<li><p>1定义bean组件    </p>
<ul>
<li>//懒惰初始化<br>@Component<br>@Lazy<br>public class Person {<br>public Person()<br>{<br>System.out.println(“创建Person”);<br>}<br>@Override<br>public  String toString()<br>{return “Tom”;}<br>}</li>
</ul>
</li>
<li><p>2.测试</p>
<ul>
<li>@Test<br>public void testPerson()<br>{<br>/<em><br>测试：懒惰初始化
</em>/<br>Person person=ctx.getBean(“person”,Person.class);<br>System.out.println(person);<br>}</li>
</ul>
</li>
<li><p>1定义bean组件</p>
<ul>
<li>public class Student {<br>public  Student()<br>{<br>System.out.println(“create student”);<br>}<br>@Override<br>public String toString()<br>{<br>return “Andy”;<br>}</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>}</p>
<pre><code>    - 2.测试

        - public void testStudent()
</code></pre><p>{<br>    Student student=ctx.getBean(“student”,Student.class);<br>    System.out.println(student);<br>    System.out.println(“OK”);<br>}</p>
<pre><code>- 4.4@Import导入配置

    - 1.定义一个配置类SysConfig 其中配置一个Date类型的bean组件 id为MyDate

        - /**
</code></pre><ul>
<li><p>系统管理模块配置信息<br>*/<br>public class SysConfig {<br> @Bean<br> public Date myDate() {</p>
<pre><code> return new Date();
</code></pre><p> }<br>}</p>
<pre><code> - 2.在主配置类利用impoort引入sysconfig

     - @Configuration
</code></pre><p>@ComponentScan(basePackages = “com.example.junit”)<br>@Import({com.example.junit.SysConfig.class})<br>public class Config {</p>
<pre><code> - 3.测试

     - @Test
</code></pre><p>public  void testMyDate()<br>{<br> Date date=ctx.getBean(“myDate”,Date.class);<br> System.out.println(date);<br>}</p>
</li>
</ul>
<h3 id="Unit2-springDI"><a href="#Unit2-springDI" class="headerlink" title="Unit2 springDI"></a>Unit2 springDI</h3><ul>
<li><p>1依赖注入</p>
<ul>
<li><p>1.1什么是依赖注入</p>
<ul>
<li>依赖注入。 依赖注入让bean与bean之间以配置文件组织在一起，而不是以硬编码的方式耦合在一起。</li>
</ul>
</li>
<li><p>1.2bean注入</p>
<ul>
<li><p>案例：模拟光头强砍树</p>
<ul>
<li><p>1.创建saw</p>
<ul>
<li>@Component<br>public class Saw implements Serializable {<br>private String name=”铁连菊”;<br>@Override<br>public String toString()<br>{<br>return name;<br>}<br>}</li>
</ul>
</li>
<li><p>2.创建worker</p>
<ul>
<li>@Component<br>public class Saw implements Serializable {<br>private String name=”铁连菊”;<br>@Override<br>public String toString()<br>{<br>return name;<br>}<br>}</li>
</ul>
</li>
<li><p>3.创建配置文件</p>
<ul>
<li>//spring会自动根据变量类型匹配主键<br>//如果匹配 就将beam注入<br>@Configuration<br>public class Config {<br>@Bean<br>public Saw saw()<br>{<br>return new Saw();<br>}<br>@Bean<br>public Worker worker(Saw saw)<br>{<br>Worker worker=new Worker();<br>worker.saw=saw;<br>return worker;<br>}<br>}</li>
</ul>
</li>
<li><p>4.测试</p>
<ul>
<li>public class test {<br>AnnotationConfigApplicationContext ctx;<br>@Before<br>public void init()<br>{<br>ctx=new AnnotationConfigApplicationContext(Config.class);<br>}<br>@After<br>public void destroy()<br>{<br>ctx.close();<br>}<br>@Test<br>public void testWorker()<br>{<br>Worker worker=ctx.getBean(“worker”,Worker.class);<br>worker.work();<br>}<br>}</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p>1.3@Autowired</p>
</li>
<li><p>1.4同时使用@bean@compont</p>
<ul>
<li><p>案例 bean声明的组件注入到component声明的组件</p>
<ul>
<li><p>1利用bean配置类config声明组件</p>
<ul>
<li>@Configuration<br>@ComponentScan(“com.example.druid”)<br>public class Config {<br>@Bean<br>public Date currentDate()<br>{<br>return new Date();<br>}<br>}</li>
</ul>
</li>
<li><p>利用component声明组件引入date类型</p>
<ul>
<li>@Component<br>public class Employee {</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>private String name=”Tom”;<br>@Autowired<br>private Date date;<br>@Override<br>public String toString()<br>{<br>  return “Employee [name=”+name+”, date=”+date+”]”;<br>}<br>}</p>
<pre><code>  - 3.测试

      - public void testEmployee()
</code></pre><p>{<br>Employee employee=ctx.getBean(“employee”,Employee.class);<br>System.out.println(employee);<br>}</p>
<ul>
<li><p>声明component声明的组件注入到bean</p>
<ul>
<li><p>1.声明bean类型</p>
<ul>
<li>public class Dept {<br>private String name;<br>private Employee manager;<br>public void setManager(Employee manager)<br>{<br>this.manager=manager;<br>}<br>@Override<br>public String toString()<br>{<br>return “Dept [name=”+name+”, manager=”+manager+”]”;<br>}<br>}</li>
</ul>
</li>
<li><p>2.在配置类config中利用bean声明bean组件</p>
<ul>
<li>@Bean<br>public Dept dept(Employee employee)<br>{<br>Dept dept=new Dept();<br>dept.setManager(employee);<br>return  dept;<br>}</li>
</ul>
</li>
<li><p>3.测试</p>
<ul>
<li>@Test<br>public void testDept()<br>{<br>Dept dept=ctx.getBean(“dept”,Dept.class);<br>System.out.println(dept);<br>}</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p>3.使用properties文件</p>
<ul>
<li><p>3.1druid连接池</p>
<ul>
<li><p>思路：</p>
<ul>
<li>1利用maven导入druid连接池api和mysql数据库驱动api</li>
<li>2将连接池作为javabean在config。Java中配置</li>
<li>3 测试连接池是否可用</li>
</ul>
</li>
<li><p>例子</p>
<ul>
<li><p>1.导入连接池</p>
<ul>
<li><dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</li>
</ul>
</li>
<li><p>2.配置config</p>
<ul>
<li>@Bean<br>public DataSource dataSource()<br>{<br>DruidDataSource ds =new DruidDataSource();<br>ds.setDriverClassName(“com.mysql.cj.jdbc.Driver”);<br>ds.setUrl(“jdbc:mysql://localhost:3306/db1?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone = GMT&amp;allowPublicKeyRetrieval=true”);<br>ds.setUsername(“root”);<br>ds.setPassword(“123456”);<br>ds.setMaxActive(10);<br>ds.setInitialSize(2);<br>return ds;<br>}</li>
</ul>
</li>
<li><p>测试</p>
<ul>
<li>@Test<br>public void testDataSource()<br>{<br>String sql=”select ‘hello world’”;<br>DataSource ds=ctx.getBean(“dataSource”,DataSource.class);<br>try(Connection conn=ds.getConnection())<br>{<br>Statement st=conn.createStatement();<br>ResultSet rs=st.executeQuery(sql);<br>while (rs.next())<br>{<br>System.out.println(rs.getString(1));<br>}<br>}<br>catch (Exception e)<br>{<br>e.printStackTrace();<br>}<br>}</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p>3.2@P{ropertySource和environment</p>
<ul>
<li><p>程序参数保存到properties文件，spring提供注解用于读取properties，保存到environment中</p>
<ul>
<li>db.driver=com.mysql.cj.jdbc.Driver<br>db.url=jdbc:mysql://localhost:3306/db1?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone = GMT&amp;allowPublicKeyRetrieval=true<br>db.username=root<br>db.password=123456<br>db.maxActive=10<br>db.initialSize=2<br>@Autowired<br>Environment env;</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>@Bean<br>public DataSource dataSource2()<br>{<br>    DruidDataSource ds=new DruidDataSource();<br>    ds.setDriverClassName(env.getProperty(“db.driver”));<br>    ds.setUrl(env.getProperty(“db.url”));<br>    ds.setUsername(env.getProperty(“db.username”));<br>    ds.setPassword(env.getProperty(“db.password”));<br>    ds.setMaxActive(env.getProperty(“db.maxActive”,Integer.class));<br>    ds.setInitialSize(env.getProperty(“db.initialSize”,Integer.class));<br>    return ds;<br>}<br>@Test<br>public void testDataSource2()<br>{<br>    String sql=”select ‘hello world’”;<br>    DataSource ds=ctx.getBean(“dataSource2”,DataSource.class);<br>    try(Connection conn=ds.getConnection())<br>    {<br>        Statement st=conn.createStatement();<br>        ResultSet rs=st.executeQuery(sql);<br>        while (rs.next())<br>        {<br>            System.out.println(rs.getString(1));<br>        }<br>    }<br>    catch (Exception e)<br>    {<br>        e.printStackTrace();<br>    }<br>}</p>
<pre><code>- 3.3value

    - 利用value读取当前系统环境environment的信息，注入到变量

        - @Bean
</code></pre><p>public DataSource dataSource3(<br>        @Value(“${db.drive}”) String driver,<br>        @Value(“${db.url}”) String url,<br>        @Value(“${db.username}”) String username,<br>        @Value(“${db.password}”) String password,<br>        @Value(“${db.maxActive}”) int maxActive,<br>        @Value(“${db.initialSize}”) int initialSize)<br>{<br>    DruidDataSource ds =new DruidDataSource();<br>    ds.setDriverClassName(driver);<br>    ds.setUrl(url);<br>    ds.setUsername(username);<br>    ds.setPassword(password);<br>    ds.setMaxActive(maxActive);<br>    ds.setInitialSize(initialSize);<br>    return ds;<br>}</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://goofyer.gitee.io/notes-on-computer-expertise/2021/12/20/Java/%E7%AC%AC%E4%B8%89%E5%8D%81%E4%B8%80%E7%AB%A0Spring/" data-id="cl403sxr00015f8vufb5l7i2f" data-title="" class="article-share-link">Share</a>
      
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/notes-on-computer-expertise/2021/12/20/Java/%E7%AC%AC%E4%B8%89%E5%8D%81%E4%BA%8C%E7%AB%A0SpringMVC/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          (no title)
        
      </div>
    </a>
  
  
    <a href="/notes-on-computer-expertise/2021/12/20/Java/%E7%AC%AC%E4%B8%89%E5%8D%81%E7%AB%A0Mybatis/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title"></div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/C-%E5%B7%A5%E5%85%B7/">C#工具</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/C-%E5%B7%A5%E5%85%B7/">C++工具</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/Mysql/">Mysql</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/blender/">blender</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/linux/">linux</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/manim/">manim</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/spring/">spring</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/vba%E5%9F%BA%E7%A1%80%E6%93%8D%E4%BD%9C/">vba基础操作</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E5%88%9B%E9%80%A0%E6%A8%A1%E5%BC%8F/">创造模式</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/">操作系统基础知识</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91/">操作系统开发</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%95%B0%E5%AD%A6/">数学</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/">数据结构基础知识</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%A8%A1%E6%9D%BF/">模板</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/">深度学习</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E8%8B%B1%E8%AF%AD/">英语</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E8%99%9A%E5%B9%BB4/">虚幻4</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90%E5%8E%9F%E7%90%86/">计算机组成原理</a></li><li class="category-list-item"><a class="category-list-link" href="/notes-on-computer-expertise/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/">计算机网络</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/notes-on-computer-expertise/tags/C/" rel="tag">C++</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/notes-on-computer-expertise/tags/C/" style="font-size: 10px;">C++</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/notes-on-computer-expertise/archives/2022/05/">May 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/notes-on-computer-expertise/archives/2022/03/">March 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/notes-on-computer-expertise/archives/2022/02/">February 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/notes-on-computer-expertise/archives/2022/01/">January 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/notes-on-computer-expertise/archives/2021/12/">December 2021</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/notes-on-computer-expertise/2022/05/31/vue/%E5%89%8D%E7%AB%AF%E6%A1%86%E6%9E%B6%E9%AA%8C%E8%AF%81%E7%A0%81%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA/">(no title)</a>
          </li>
        
          <li>
            <a href="/notes-on-computer-expertise/2022/05/26/%E6%95%B0%E6%8D%AE%E5%BA%93/navicat%E5%AE%89%E8%A3%85/">(no title)</a>
          </li>
        
          <li>
            <a href="/notes-on-computer-expertise/2022/05/25/%E8%99%9A%E5%B9%BB4%E5%BC%95%E6%93%8E%E5%BC%80%E5%8F%91/%E8%99%9A%E5%B9%BB%E5%9B%9B%20mod%E5%88%B6%E4%BD%9C/">(no title)</a>
          </li>
        
          <li>
            <a href="/notes-on-computer-expertise/2022/05/23/python/python%E6%89%B9%E9%87%8F%E7%94%9F%E6%88%90%E6%95%B0%E6%8D%AE/">(no title)</a>
          </li>
        
          <li>
            <a href="/notes-on-computer-expertise/2022/05/23/vba%E5%9F%BA%E7%A1%80%E6%93%8D%E4%BD%9C%E7%AC%94%E8%AE%B0/EXCEL%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/">(no title)</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2022 John Doe<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/notes-on-computer-expertise/" class="mobile-nav-link">Home</a>
  
    <a href="/notes-on-computer-expertise/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/notes-on-computer-expertise/js/jquery-3.4.1.min.js"></script>



  
<script src="/notes-on-computer-expertise/fancybox/jquery.fancybox.min.js"></script>




<script src="/notes-on-computer-expertise/js/script.js"></script>





  </div>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [ ["$","$"], ["\\(","\\)"] ],
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
            processEscapes: true
        }
    });
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax();
        for (var i = 0; i < all.length; ++i)
            all[i].SourceElement().parentNode.className += ' has-jax';
    });
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
</body>
</html>